/**
 * 多线程的创建与使用
 *
 * @author DuJiabao
 * @create 2020-12-12 20:17
 */
public class ThreadTest {
    public static void main(String[] args) {
        EvenThread evenThread = new EvenThread();  //alt+Enter创建新对象
        OvdThread ovdThread = new OvdThread();
        evenThread.start();
        ovdThread.start();
    }
}


class EvenThread extends Thread {
    @Override
    public void run() {
        super.run();
        for (int i = 0; i < 100; i += 2) {
            System.out.println(i);
        }
    }
}

class OvdThread extends Thread {
    @Override
    public void run() {
        super.run();
        for (int i = 1; i < 100; i += 2) {
            System.out.println(i);
        }
    }
}